# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : 特征预处理（归一化）.py
# @Author: dongguangwen
# @Date  : 2025-01-19 14:59
# 1.导入工具包
from sklearn.preprocessing import MinMaxScaler

# 2.数据(只有特征)
x = [[90, 2, 10, 40], [60, 4, 15, 45], [75, 3, 13, 46]]

# 3.实例化(归一化)
process = MinMaxScaler()

# 4.fit_transform 处理
data = process.fit_transform(x)

print(data)
"""
[[1.         0.         0.         0.        ]
 [0.         1.         1.         0.83333333]
 [0.5        0.5        0.6        1.        ]]
"""
